<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>demo03-obj-ref-change</title>
</head>
<script>

    let obj1 = new Object();
    obj1.username = 'aa'
    obj1.age = 18

    let obj2 = obj1 

    obj1 = new Object();
    obj1.addr = 'dddaaarrr'

    /**
     * 有点颠覆三观。。。。。。
     * obj1分配了新的空间。obj2还是引用的旧地址。。。
     */  
    console.log(obj1);
    console.log(obj2);
    console.log( obj1 == obj2 ); // false

</script>
<body>
    
</body>
</html>